<template>
	<view class="my-recommend">
		<view class="rec-item" v-for="(item, index) in list" :key="index">
			<view class="avatar">
				<image class="img" :src="item.photoUrl"></image>
			</view>
			<view class="user-info">
				<view class="name">
					{{ item.custName }}
				</view>
				<view class="info">
					推荐类型：<text class="txt">{{ item.recomType == 'GG' ? '雇工' : '雇主' }}</text>
				</view>
			</view>
			<view class="status">
				<template v-if="item.isReward">
					<image class="img" src="../../static/image/pay.png"></image>
					<text>已奖励</text>
				</template>
				<template v-else>
					<image class="img" src="../../static/image/check.png"></image>
					<text>已成功</text>
				</template>
			</view>
		</view>
		<view class="empty" v-if="list.length == 0">
			<u-empty text="暂无数据哦" :margin-top="100"></u-empty>
		</view>
	</view>
</template>

<script>
export default {
	name: 'myRecommend', // 我的推荐
	data() {
		return {
			list: []
		}
	},
	onLoad() {
		this.queryList();
	},
	methods: {
		queryList() {
			let params = {};
			this.$u.api.postGetMyRecommend(params).then(res => {
				if(res.status == true) {
					let data = res.data;
					this.list  = data;
				}
			})
		}
	}
}
</script>

<style lang="scss" scoped>
.my-recommend {
	padding: 20rpx;
	.rec-item {
		display: flex;
		align-items: center;
		padding: 26rpx 20rpx;
		background: #fff;
		margin-bottom: 20rpx;
		.avatar {
			width: 96rpx;
			height: 96rpx;
			margin-right: 20rpx;
			border-radius: 50%;
			overflow: hidden;
			.img {
				width: 100%;
				height: 100%;
			}
		}
		.user-info {
			flex: 1;
			.name {
				font-size:26rpx;
				font-weight:500;
				color:rgba(51,51,51,1);
				margin-bottom: 10rpx;
			}
			.info {
				font-size:24rpx;
				font-weight:500;
				color:#999;
				.txt {
					color: #333;
				}
			}
		}
		.status {
			.img {
				width: 40rpx;
				height: 40rpx;
				vertical-align: middle;
				margin-right: 10rpx;
			}
		}
	}
}
</style>
